package org.compression.thread;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;

import org.compression.constant.Constant;
import org.compression.util.SearchTxtServiceUtil;

public class PdfCom  implements Runnable {

	public int deflautpage=0;
	public String comStr;
	public File pdfFile;
	
	
	public PdfCom(int deflautpage,String comStr,File pdfFile) {
			this.deflautpage=deflautpage;
			this.comStr=comStr;
			this.pdfFile=pdfFile;
	}
	
	
	@Override
	public void run() {
		try {
			Object hashPage = SearchTxtServiceUtil.compare(comStr, pdfFile, deflautpage);
			System.out.println("开始"+Thread.currentThread().getName()+"页数："+deflautpage);
			Constant.listFilepath.put(pdfFile.getName(), hashPage);
			System.out.println("结束"+Thread.currentThread().getName()+"页数："+deflautpage);
			Thread.currentThread().stop();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
	
	
	
	
}